﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="CreateReservations._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to our website for online reservations!
    </h2>
    <div class="catTemp">
        Categories:
    </div>
    <asp:Repeater ID="categoriesRepeater" runat="server">
        <ItemTemplate>
            <div class="catTemp">
                <a href="EventsByCategories.aspx?catId=<%# Eval("CategoryId") %>">
                    <%# Server.HtmlEncode(Eval("CategoryType").ToString()) %>
                </a>
            </div>  
        </ItemTemplate>
    </asp:Repeater>
    <br />
    <p>
        <b>This is a list of all our upcoming events:</b>
    </p>
    <asp:Repeater ID="eventsRepeater" runat="server">
        <ItemTemplate>
            <div class="itemTemp">
                <div class="info">
                    <b>Event Id: <%# Eval("EventId") %></b>
                    <br />
                    Title: <%# Server.HtmlEncode(Eval("Title").ToString())%>
                    <br />
                    Price: <%# string.Format("{0:c}", Eval("Price"))%>
                    <br />
                    Date and time: <%# Eval("DateAndTime", "{0:dd/MM/yyyy hh-mm tt }")%>
                    <br />
                    Location:  <%# Server.HtmlEncode(Eval("Location.LocationName").ToString()) %>                        
                    <br />
                    Category: <%# Server.HtmlEncode(Eval("Category.CategoryType").ToString())%>
                    <br />
                </div>

                <div class="buttons">
                    <div class="button"><a href="PurchaseTickets.aspx?eveId=<%# Eval("EventId") %>">Purchase Tickets</a></div>
                </div>   
            </div>  
        </ItemTemplate>
    </asp:Repeater>  

    <asp:Repeater ID="rptPages" Runat="server" 
        onitemcommand="rptPages_ItemCommand">
        <HeaderTemplate><h4>Page:</h4></HeaderTemplate>
        <ItemTemplate>
            <div class="catTemp">
                 <asp:LinkButton ID="btnPage"
                                 CommandName="Page"
                                 CommandArgument="<%#
                                 Container.DataItem %>"
                                 CssClass="text"
                                 Runat="server"><%# Container.DataItem %>
                                 </asp:LinkButton>&nbsp;
            </div>
        </ItemTemplate>
      </asp:Repeater>
</asp:Content>
